package com.cn.por.auto.vue;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * 生成大屏vue基础文件，基于vue2
 */
public class DashboardVueGrt {

    /**
      -- =============================================
      -- 功能描述: 根据文件名称将vue2大屏文件生成到指定文件目录下
      -- 入参描述: folder,fileName
      -- 出参描述:
      -- 返回值描述: void
      -- 作者: xw
      -- 创建时间: 2024/5/21 10:03
      -- =============================================
     */
    public static void crtVueDashboard(String folder,String fileName){

    }

    public static void main(String[] args) {
        /**
         * 将vue文件转换为Document对象
         */
        String filePath = "generator/vue/dashboard.vue";
        ClassLoader classLoader = DashboardVueGrt.class.getClassLoader();
        try {
            URL resourceUrl = classLoader.getResource(filePath);
            Document doc = Jsoup.parse(new File(resourceUrl.toURI()), "UTF-8");
            System.out.println(doc.text());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
